Page({
  data: {},
  onLoad(option) {
    var that = this;
    that.setData({
      option: option
    })
    console.log(option.id);
    my.httpRequest({
      url: 'https://zfbzzbj.chuangkegf.com/public/index.php/api/flink/detail',
      method: 'POST',
      data: {
        id: option.id
      },
      dataType: 'json',
      success: function (res) {
        if (res.status == 200) {
          that.setData({
            data: res.data.data
          })
        } else {
          my.alert({ content: '网络错误！请稍后重试' });
        }
      },
      fail: function (res) {
        my.alert({ content: '网络错误！请稍后重试' });
      }
    });
    my.setNavigationBar({
      title: option.title,
      backgroundColor: '#4957B4'
    });
  },
  yuyue() {
    var that = this;
    my.navigateTo({
      url: '../yuyue/yuyue?title=' + that.data.option.title
    })
  },
  phone() {
    var that = this;
    my.makePhoneCall({ number: that.data.data.phone })
  }
});
